﻿// ....................................................................................................................
//	Author: Copyright (C) 2012 Ing. Marek Hubal
//	Email: hubal@acasoftware.org
// ....................................................................................................................

using System;

namespace core
{
    /// <summary>Trieda core2</summary>
	public class core2
	{
        [System.Runtime.InteropServices.DllImport("core2.dll", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]
        public static extern long GetDeviceCapacity(string pPath);
        [System.Runtime.InteropServices.DllImport("core2.dll", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]
        public static extern long GetDeviceFreeSpace(string pPath);

        [System.Runtime.InteropServices.DllImport("core2.dll", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]
        public static extern IntPtr AllocateMemory(int pCapacity);
        [System.Runtime.InteropServices.DllImport("core2.dll", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]
        public static extern void FreeMemory(IntPtr pHandle);

        [System.Runtime.InteropServices.DllImport("core2.dll", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]
        public static extern IntPtr OpenLocalFileForRead(string pFileName);
        [System.Runtime.InteropServices.DllImport("core2.dll", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]
        public static extern IntPtr CreateLocalFile(string pFileName);
        [System.Runtime.InteropServices.DllImport("core2.dll", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]
        public static extern void CloseLocalFile(IntPtr pHandle);
        [System.Runtime.InteropServices.DllImport("core2.dll", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]
        public static extern int WriteToLocalFile(IntPtr pHandle, IntPtr pData, int pLength);
        [System.Runtime.InteropServices.DllImport("core2.dll", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]
        public static extern int ReadFromLocalFile(IntPtr pHandle, IntPtr pData, int pMaxLength);
        [System.Runtime.InteropServices.DllImport("core2.dll", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]
        public static extern int SetFileDateTime(string pName, ulong pDCreate, ulong pDModify, ulong pDLastAccess);
    }
}
